package cn.tedu.zhyl.system.mapper;

import cn.tedu.zhyl.system.pojo.dto.LoginDTO;
import cn.tedu.zhyl.system.pojo.dto.SysUserParams;
import cn.tedu.zhyl.system.pojo.dto.SysUserQuery;
import cn.tedu.zhyl.system.pojo.entity.SysUser;
import cn.tedu.zhyl.system.pojo.vo.SysUserVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SysUserMapper {
    SysUser findByUsername(LoginDTO loginDTO);
    String findNameById(Long id);
    List<SysUserVO> findByQuery(SysUserQuery sysUserQuery);

    @Update("update sys_user set is_deleted = #{status} where id = #{uid}")
    void updateUserStatus(@Param("uid") Long uid,@Param("status") Integer status);

    @Update("update sys_user set password=123456 where id = #{uid}")
    void resetPassword(Long uid);

    @Update("update sys_user set is_deleted=1 where id = #{uid}")
    void deleteUser(Long uid);

    void insert(SysUserParams sysUserParams);

    void update(SysUserParams sysUserParams);
}
